from django.contrib import admin
from django.urls import path, re_path, include
from django.views.static import serve
from django.conf import settings

# xadmin的依赖
import xadmin
xadmin.autodiscover()
# xversion模块自动注册需要版本控制的 Model
# from xadmin.plugins import xversion
# xversion.register_models()

urlpatterns = [
    # path('admin/', admin.site.urls),
    path(r'xadmin/', xadmin.site.urls),

    # 用户app
    path('user/', include('user.urls')),
    # 主页app
    path('home/', include('home.urls')),
    # 课程app
    path('course/', include('course.urls')),
    # 订单app
    path('order/', include('order.urls')),

    # 媒体文件
    re_path("^media/(?P<path>.*)", serve, {"document_root":settings.MEDIA_ROOT})
]
